<template>
  <div>
    <!-- 表格 -->
    <div>
      <el-table
      border
      :data="waiterData"
      height='calc(100vh - 150px)'
      stripe
      style="width: 100%">
      <el-table-column
        prop="id"
        label="编号"
        width="100">
      </el-table-column>
      <el-table-column
        prop="realname"
        label="姓名"
        width="100">
      </el-table-column>
      <el-table-column
        prop="telephone"
        label="手机号">
      </el-table-column>
      <el-table-column
        prop="idCard"
        label="身份证号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="bankCard"
        label="银行卡号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="registerTime"
        label="注册时间">
      </el-table-column>
      <el-table-column
        prop="status"
        label="状态">
      </el-table-column>
      <el-table-column
      fixed="right"
      label="操作"
      width="100">
      <template slot-scope="scope">
        <el-button @click="audit(scope.row)" type="text" size="small">审核</el-button>
      </template>
    </el-table-column>
    </el-table>
    </div>
    <!-- 分页 -->
    <div>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="queryParams.page"
        :page-size="queryParams.pageSize"
        layout="total, prev, pager, next"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex';
export default {
  data() {
    return {
      queryParams:{
        page:1,
        pageSize:10,
        status:''
      }
    };
  },
  computed: {
    ...mapGetters('waiter',['total','waiterData'])
  },
  methods: {
    ...mapActions('waiter',['findAll']),
    //审核
    audit(){},
    handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
    handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.queryParams.page=val;
        this.findAll(this.queryParams);
    }
  },
  created() {
    this.findAll(this.queryParams)
  },
  mounted() {},
};
</script>
<style lang="less" scoped>
</style>